/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import framework.dal.GroupDB;
import framework.groups.Group;
import framework.groups.GroupStrategy;
import java.util.ArrayList;

/**
 *
 * @author Guilherme
 */
public class Manager
{
    public static GroupStrategy STRATEGY;
    
    //<editor-fold defaultstate="collapsed" desc="Getter">
    public static ArrayList<Group> getGroups()
    {
        return STRATEGY.GROUPS;
    }
    //</editor-fold>
    
    public static void retrieveData()
    {
        STRATEGY.GROUPS = GroupDB.getAll();
    }
    
    public static void setStrategy(GroupStrategy s)
    {
        STRATEGY = s;
    } 
    
    public static Object[][] nameGroupsArray()
    {
        String[][] names = new String[STRATEGY.GROUPS.size()][1];
        int i = 0;
        for (Group g : STRATEGY.GROUPS)
        {
            names[i][0] = g.getNameGroup();
            i++;
        }
        return names;
    }
}
